package com.ce.pms.common.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.ce.pms.customer.model.ParticipantDO;
import com.ce.pms.house.model.HouseDomain;
import com.sitechasia.webx.core.model.IDomainObject;
/**
 * 实体名称:业务管理操作日志 关联数据表:BIZ_ACTION_LOG
 *
 */
@Entity
@Table(name = "BIZ_ACTION_LOG")
public class BIZActionLogDomain implements IDomainObject {

	/**
	 * 操作日志ID
	 */
	@Id
	@GeneratedValue
	@Column(name = "ACTION_ID")
	private Long actionId;

	/***
	 * 房屋
	 */
	@ManyToOne
	@JoinColumn(name = "HOUSE_ID", nullable = false)
	private HouseDomain house;

	/***
	 * 如果数据字典表定义的 BIZ_LOG_ACTION_TYPE值
            004 新增业主
            005 修改业主
            006 删除业主
            007 新增租户
            008 修改业主
            009 删除业主
            该字段不能为空
	 */
	@ManyToOne
	@JoinColumn(name = "PARTICIPANT_ID")
	private ParticipantDO participant;



	/****
	 * 参考数据字典表定义(BIZ_LOG_ACTION_TYPE)
            001 新增房间
            002 修改房间
            003 删除房间
            004 新增业主
            005 修改业主
            006 删除业主
            007 新增租户
            008 修改租户
            009 删除租户
            010 新增家庭成员
            011 修改家庭成员
            012 删除家庭成员
            013 入住
            014 搬出
            015 入伙（实际发生在缴钥匙结束）
            016 退伙（实际发生在变为历史业主）
	 */
	@Column(name = "LOG_ACTION_TYPE", nullable = false, length = 3)
	private String actionType;

	/**
	 * 操作描述
	 */
	@Column(name = "ACTION_DESCRIPTION", length = 1000)
	private String actionDescription;

	/***************************************************************************
	 * 终端IP
	 */
	@Column(name = "TERMINAL_IP")
	private String terminalIP;

	/***************************************************************************
	 * 终端
	 */
	@Column(name = "TERMINAL")
	private String terminal;

	/***************************************************************************
	 * 操作员
	 */
	@Column(name = "ACTION_USER", nullable = false)
	private Long actionUserId;

	/**
	 * 操作日期
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "ACTION_DATE", nullable = false)
	private Date actionDate;

	/**
	 * 备注
	 */
	@Column(name = "REMARK", length = 500)
	private String remark;

	public BIZActionLogDomain() {

	}

	/**********************************construct*************************************
	 *
	 * @param house
	 *            房屋
	 * @param actionType
	 *            操作类型
	 * @param actionUserId
	 *            操作人
	 * @param actionDate
	 *            操作时间
	 */
	public BIZActionLogDomain(HouseDomain house,String actionType,Long actionUserId,Date actionDate) {
		this.house = house;
		this.actionType = actionType;
		this.actionUserId = actionUserId;
		this.actionDate = actionDate;
	}

	/******************************getters and setters ******************************/

	public Date getActionDate() {
		return actionDate;
	}

	public void setActionDate(Date actionDate) {
		this.actionDate = actionDate;
	}

	public String getActionDescription() {
		return actionDescription;
	}

	public void setActionDescription(String actionDescription) {
		this.actionDescription = actionDescription;
	}

	public Long getActionId() {
		return actionId;
	}

	public void setActionId(Long actionId) {
		this.actionId = actionId;
	}

	public Long getActionUserId() {
		return actionUserId;
	}

	public void setActionUserId(Long actionUserId) {
		this.actionUserId = actionUserId;
	}

	public String getActionType() {
		return actionType;
	}

	public void setActionType(String actionType) {
		this.actionType = actionType;
	}

	public HouseDomain getHouse() {
		return house;
	}

	public void setHouse(HouseDomain house) {
		this.house = house;
	}

	public ParticipantDO getParticipant() {
		return participant;
	}

	public void setParticipant(ParticipantDO participant) {
		this.participant = participant;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getTerminal() {
		return terminal;
	}

	public void setTerminal(String terminal) {
		this.terminal = terminal;
	}

	public String getTerminalIP() {
		return terminalIP;
	}

	public void setTerminalIP(String terminalIP) {
		this.terminalIP = terminalIP;
	}
}
